package com.hzgj.demo.e;

import com.google.common.collect.Lists;
import com.hzgj.demo.g.GService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Random;

/**
 * Created by Administrator on 2016/9/22.
 */
@Component
public class EServiceImpl implements EService {

    @Autowired
    private GService gService;

    @Override
    public ERet getServiceFromG() {
        int length = new Random().nextInt(150);
        List<String> data = Lists.newArrayList();
        for (int i = 0; i < length; i++) {
            data.add("user" + i);
        }
        String retFromG = gService.getService();
        return new ERet(data, retFromG);
    }
}
